#ifndef OSGGeodeTool_H
#define OSGGeodeTool_H

#include <osg/Geode>
#include <osgGe/Vec3d>
#include <osg/LineWidth>
#include <osgText/Text>
#include <osg/MatrixTransform>
#include <osg/LightSource>
#include <osg/Image>
#include <osg/Geometry>
#include <osgGe/Vec3>
#include <osgGe/Vec4>
#include <osg/Billboard>

#include <osg/Projection>
#include <OsgExTool/Export>

namespace OsgExTool {

	//图形工具集
class OsgExTool_EXPORT OsgExToolGeode
{
public:
/**
 * @brief createAX_  生成坐标系
 * @param origin     原点
 * @param x          x方向的坐标
 * @param y          y方向的坐标
 * @param z          z方向的坐标
 * @return
 */
static osg::ref_ptr<osg::Node> createAX_(osg::Vec3 origin, osg::Vec3 x, osg::Vec3 y, osg::Vec3 z);

/**
 * @brief createGeode_color 输入一系列点,颜色,数据类型,绘制模型
 * @param v                 输入一系列点
 * @param c                 颜色
 * @param type              绘制类型
 * @return
 */
static  osg::ref_ptr<osg::Geode> createGeode_color(osg::ref_ptr<osg::Vec3Array> v, osg::ref_ptr<osg::Vec4Array> c, GLenum  type);

/**
 * @brief createGeode   输入一系列点,颜色,数据类型,绘制模型
 * @param v             输入一系列点
 * @param type          绘制类型
 * @param color         统一的颜色
 * @return
 */
static  osg::ref_ptr<osg::Geode> createGeode(osg::ref_ptr<osg::Vec3Array> v, GLenum type, osg::Vec4 color);

static  osg::ref_ptr<osg::Geode> createQuadAnimation(double w, double h, osg::Vec4 color);

/**
 * @brief createGeode  输入一系列点绘制多个三角形
 * @param points       一系列点
 * @param colors       渐变色的第一个颜色
 * @param color2       渐变色的第二个颜色
 * @param width        线宽
 * @param mat          变换矩阵
 * @return
 */
static  osg::ref_ptr<osg::Geode> createGeode(std::vector<osg::Vec3f> points, osg::Vec4f colors, osg::Vec4f color2, double width = 0.1, osg::Matrix mat = osg::Matrix::identity());
static  osg::ref_ptr<osg::Geode> createGeode(std::vector<osg::Vec3f> points, osg::Vec4f colors, double width = 0.1, osg::Matrix mat = osg::Matrix::identity(), int div = 1);
static  osg::ref_ptr<osg::Geode> createDotGeode(std::vector<osg::Vec3f> points, osg::Vec4f colors, double width = 0.1, osg::Matrix mat = osg::Matrix::identity(), int div = 1);
static  osg::ref_ptr<osg::Geode> createGeode(std::vector<osg::Vec3d> points, std::vector<osg::Vec4d> colors, double width = 0.1);

static osg::ref_ptr<osg::Geode> createGeodeTrangle(std::vector<osg::Vec3f>& points, std::vector<osg::Vec3f>& normal, osg::Vec4f colors);

static  osg::ref_ptr<osg::Geode> createMingSunTu(double before, double behind, double mTopSideLenth, double mBottomSideLenth, double mHeight, double mAngle, double Sectionlen, osg::Vec4f color);
static  osg::ref_ptr<osg::Geode> createMingSunAo(double before, double hehind, double mTopSideLenth, double mBottomSideLenth, double mHeight, double mAngle, double Sectionlen, osg::Vec4f color);

static  osg::ref_ptr<osg::Geode> createAnSunTu(double x0, double before, double behind, double mTopSideLenth, double mBottomSideLenth, double mHeight, double mAngle, double Sectionlen,
double mWidthRect, double mHeightRect, double mRectLenth, osg::Vec4f color);

static  osg::ref_ptr<osg::Geode> createAnSunAo(double x0, double before, double hehind, double mTopSideLenth, double mBottomSideLenth, double mHeight, double mAngle, double Sectionlen,
double mWidthRect, double mHeightRect, double mRectLenth, osg::Vec4f color);
/**
 * @brief createCircle   生成圆
 * @param center         中心
 * @param radius         半径
 * @param colorss        颜色
 * @return
 */
static  osg::ref_ptr<osg::Geode> createCircle(osg::Vec3f center, double radius, osg::Vec4f colors);
static  osg::ref_ptr<osg::Geode> createCircle(std::vector<osg::Vec3d> points, std::vector<osg::Vec4d> colors);
static  osg::ref_ptr<osg::Geode> createCircle(double radius, osg::Vec3 center = osg::Vec3(0.0, 0.0, 0.0), osg::Vec4 color = osg::Vec4(1.0, 1.f, 1.f, 1.f));
static  osg::ref_ptr<osg::Geode> createCircleFace(osg::Vec3f center, double radius, osg::Vec4f colors);
/**
 * @brief createQuadColor    生成四边形, textureID 表示带纹理
 * @param x                  中心坐标x
 * @param y                  中心坐标y
 * @param width              宽
 * @param height             高
 * @param color              颜色
 * @return
 */
static  osg::ref_ptr<osg::Geode> createQuadColor(double x, double y, double width, double height, osg::Vec4 color);
static  osg::ref_ptr<osg::Geode> createQuadTexture(double x, double y, double width, double height, int textureID);
static  osg::ref_ptr<osg::Geode> createQuadTexture(double width, double height, std::string textureID);

	};

}

using namespace OsgExTool;
#endif


